var app = getApp();
Page({
  data: {
    userid: 0,
    isremove: false,
    headerArray: [{
      text: '学号',
    }, {
      text: '姓名'
    }, {
      text: '专业'
    }, {
      text: '班级'
    }, {
      text: '手机号'
    }],
    userList: []
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.onShow();
  },
  onShow: function () {
    var that = this;
    var major = getApp().globalData.major;
    var grade = getApp().globalData.grade;
    wx.request({
      url: 'http://localhost:8080/clock_war_exploded/user/findByGrade',
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded;charset=utf-8'
      },
      data: {
        major: major,
        grade: grade
      },
      success: function (res) {
        if (res.data != null) {
          console.log(res.data)
          that.setData({
            searchLoading: true, //把"上拉加载"的变量设为true，显示  
            searchLoadingComplete: false, //把“没有数据”设为false，隐藏 
            userList: res.data
          })
        } else {
          that.setData({
            searchLoadingComplete: true, //把“没有数据”设为true，显示  
            searchLoading: false //把"上拉加载"的变量设为false，隐藏  
          })
        }
      }
    })
  }
})